package com.github.yangkl.demo.navigation.business

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.github.yangkl.demo.navigation.R

class LoginFragment : Fragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        val view = inflater.inflate(R.layout.fragment_login, container, false)
        view.findViewById<TextView>(R.id.action_to_register).setOnClickListener {
            val navController = findNavController()
            navController.navigate(R.id.action_loginFragment_to_registerFragment)
        }
        return view
    }
}